package com.xjgzinfo.usdp.core.domain;

import java.util.List;

public class PageWapper<T> {
    private long current = 1 ;
    private long pages = 1 ;
    private List<T> records;
    private long size = 0 ;
    private long total = 0;

    public PageWapper(long current, long pages, List<T> records, long size, long total) {
        this.current = current;
        this.pages = pages;
        this.records = records;
        this.size = size;
        this.total = total;
    }

    public long getCurrent() {
        //avue当前页从1开始问题
        if(current + 1 <= this.pages){
            return current + 1;
        }else{
            return this.pages;
        }
    }

    public void setCurrent(long current) {
        this.current = current;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Override
    public String toString() {
        return "PageWapper{" +
                "current=" + current +
                ", pages=" + pages +
                ", records=" + records +
                ", size=" + size +
                ", total=" + total +
                '}';
    }
}
